﻿namespace Infrastructure.Models.Others
{
    public class ApiResult1<T>
    {
        public int Code { get; set; } = 200;
        public string Message { get; set; } = string.Empty;
        public T Data { get; set; }

    }

    public class ApiResult1 : ApiResult1<object>
    {

        //public static ApiResult<T> Ok<T>(T data, string msg = "成功")
        //{
        //    ApiResult<T> apiResult = new ApiResult<T>
        //    {
        //        Code = 200,
        //        Message = msg,
        //        Data = data,
        //    };
        //    return apiResult;
        //}
        public static ApiResult1 Success(object data)
        {
            return new ApiResult1
            {
                Code = 200,
                Message = "",
                Data = data,
            };
        }

        public static ApiResult1 Error(string msg)
        {
            return new ApiResult1
            {
                Code = -1,
                Message = msg,
                Data = "",
            };
        }
    }
}
